package api

import (
	"github.com/gin-gonic/gin"
)

func Success(c *gin.Context, data interface{}, msg ...string) {
	c.JSON(200, gin.H{
		"code": 200,
		"data": data,
		"msg":  msg,
	})
	c.Abort()
}
func Fail(c *gin.Context, msg string, data ...interface{}) {
	c.JSON(200, gin.H{
		"code": 400,
		"data": data,
		"msg":  msg,
	})
	c.Abort()

}
func Json(c *gin.Context, code int, data interface{}, msg ...string) {
	c.JSON(200, gin.H{
		"code": code,
		"data": data,
		"msg":  msg,
	})
	c.Abort()
}
